import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { UserModule } from './user/user.module';
//多的不要，会报错，找不到依赖
// import { UserService } from './user/user.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { user } from './user/entity/user.entity';
import { product } from './product/entity/product.entity';
import { uploadImage } from './imagefile/entity/uploadimage.entity';
import { AuthModule } from './auth/auth.module';
import { Web3Service } from './web3/web3.service';
import { Web3Module } from './web3/web3.module';
import { ProductModule } from './product/product.module';
import { ImagefileModule } from './imagefile/imagefile.module';
@Module({
  imports: [ConfigModule.forRoot({isGlobal:true}),
    TypeOrmModule.forRoot({
      type: 'mysql',
      host: 'localhost',
      port: 3306,
      username: 'root',
      password: '123456',
      database: 'blockchain',
      entities: [user,product,uploadImage],
      synchronize: true,
    }),
    UserModule,
    AuthModule,
    Web3Module,
    ProductModule,
    ImagefileModule
  ],
  controllers: [],
  providers: [Web3Service],
  exports: [Web3Service],
})
export class AppModule {}
